<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<html>
<head>
    <title>服务器信息</title>
    <meta name="decorator" content="ani"/>
    <script type="text/javascript">

        $(document).ready(function () {


        });

        function save() {
            var i = $("#inputForm").validate({
                rules: {
                    storeno: {
                        required: true,
                        number: true
                    },
                    port: {
                        required: true,
                        number: true,
                        maxlength: 2,
                        minlength: 2
                    }
                },
                messages: {
                    storeno: "请输入数值",
                    port: "请输出2位整位"
                }
            });
            var isValidate = jp.validateForm('#inputForm');//校验表单

            if (!isValidate) {
                return false;
            } else {
                jp.loading();
                var data = $('#inputForm').serialize();
                //alert(JSON.stringify(data))
                jp.post("${ctx}/DataHub/saveInterface", data, function (data) {
                    if (data.success) {
                        jp.getParent().refresh();
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                        jp.success(data.msg)

                    } else {
                        jp.error(data.msg);
                    }
                })
            }

        }
    </script>
</head>
<body class="bg-white">
<form:form id="inputForm" modelAttribute="interfaceList" class="form-horizontal">
    <form:hidden path="id"/>
    <table class="table table-bordered">
        <tbody>
        <tr>
            <td class="width-15 active"><label class="pull-right">系统模块：</label></td>
            <td class="width-35">
                <form:select path="sysname" class="form-control required">
                    <form:options items="${fns:getDictList('system_module')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </td>
            <td class="width-15 active"><label class="pull-right">接口名：</label></td>
            <td class="width-35">
                <form:input path="interfacename" htmlEscape="false" class="form-control required"/>
            </td>
        </tr>
        <tr>
            <td class="width-15 active"><label class="pull-right">接口类型：</label></td>
            <td class="width-35">
                <form:select path="interfacetype" class="form-control required">
                    <form:options items="${fns:getDictList('interface_type_info')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </td>
            <td class="width-15 active"><label class="pull-right">描述：</label></td>
            <td class="width-35">
                <form:input path="descr" htmlEscape="false" class="form-control required"/>
            </td>
        </tr>
        <tr>
            <td class="width-15 active"><label class="pull-right">状态：</label></td>
            <td class="width-35">
                <form:select path="status" class="form-control required" >
                    <form:options items="${fns:getDictList('interface_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </td>
            <td class="width-15 active"><label class="pull-right">文件名：</label></td>
            <td class="width-35">
                <form:input path="filename" htmlEscape="false" class="form-control required"/>
            </td>
        </tr>
        <tr>
            <td class="width-15 active"><label class="pull-right">文件路径：</label></td>
            <td class="width-35">
                <form:input path="filepath" htmlEscape="false" class="form-control required"/>
            </td>
            <td class="width-15 active"><label class="pull-right">操作平台：</label></td>
            <td class="width-35">
<%--                <form:input path="platform" htmlEscape="false" class="form-control required"/>--%>
                    <form:select path="platform" class="form-control required">
                        <form:options items="${fns:getDictList('platform_name')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                    </form:select>
            </td>
        </tr>
        <tr>
            <td class="width-15 active"><label class="pull-right">文件前缀：</label></td>
            <td class="width-35">
                <form:input path="fileformat" htmlEscape="false" class="form-control required"/>
            </td>
            <td class="width-15 active"><label class="pull-right">文件的缀：</label></td>
            <td class="width-35">
                <form:input path="filesuffix" htmlEscape="false" class="form-control required"/>
            </td>
        </tr>
        <tr>
            <td class="width-15 active"><label class="pull-right">服务器列表：</label></td>
            <td class="width-85" colspan="3">
                <form:input path="servicelist" htmlEscape="false" class="form-control required"/>
<%--                     <sys:treeselect id="servicelist" name="servicelist.name" value="${interfaceList.platformInfo.value}"--%>
<%--                    labelName="servicelist" labelValue="${interfaceList.platformInfo.value}"--%>
<%--                    title="部门" url="/DataHub/treeData" cssClass="form-control required"--%>
<%--                    allowClear="true" notAllowSelectParent="true" checked="true"/>--%>
            </td>
        </tr>
        </tbody>
    </table>
</form:form>
</body>
</html>